apiready = function() {
    seajs.use(['../../V', "../../api", "../../jquery", "../../app", "../../service", "../../swiper", "../../dialog"], function(V, $api, $, app, service, Swiper, dialog) {
      app.ready();
        var vm = {
            el: '.container',
            data: {
                shopId: '',
                userInfo: '',
                unionid: '',
                goodsObj: {}
            },
            created: function() {
                var that = this;

                api.addEventListener({
                    name: 'exposureList'
                }, function(ret, err){
                    if( ret ){
                      that.goodsObj = ret.value.goodsObj
                      if (that.goodsObj.status == 2) {
                          that.goodsObj.status_msg = '通过'
                      } else if (that.goodsObj.status == 1) {
                          that.goodsObj.status_msg = '待审核'
                      }else if(that.goodsObj.status == -1){
                        that.goodsObj.status_msg = '被拒绝'
                      }
                    }
                });

                this.init();
            },
            mounted: function() {
                var that = this;
            },

            methods: {
                init: function() {
                    this.shopId = api.pageParam.shopId; // 商店id
                    this.unionid = $api.getStorage("shop_unionid"); // 用户id
                    this.userInfo = $api.getStorage("user").data; // 用户
                    if(api.pageParam.goodsObj){
                      this.goodsObj = api.pageParam.goodsObj; // 商品id
                    }
                    if (this.goodsObj.status == 2) {
                        this.goodsObj.status_msg = '通过'
                    } else if (this.goodsObj.status == 1) {
                        this.goodsObj.status_msg = '待审核'
                    }else if(this.goodsObj.status == -1){
                      this.goodsObj.status_msg = '被拒绝'
                    }
                },
								toEdit: function(){
					        var obj = {
					          goods_id: this.goodsObj.goods_id,
										name: this.goodsObj.name,
										cover: this.goodsObj.cover,
										price: this.goodsObj.sale_price,
										intro: this.goodsObj.intro,
                    status:this.goodsObj.status
					        }
									app.openWin('applyToExposure',{shopId:this.shopId, goodsObj: obj})
								},

            }
        };
        // var shopVue = new Vue(vm);
        var even = function() {

        };

        var newVue = new Vue(vm);
        even();

    })
}
